package com.level2app.adapter;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ImageView;

import androidx.annotation.NonNull;
import androidx.annotation.Nullable;

import com.bumptech.glide.Glide;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.QuickViewHolder;
import com.level2app.R;
import com.level2app.bean.NotificationsBean;

/**
 * Created by S
 * time 2024/8/24
 */
public class NotificationsAdapter extends BaseQuickAdapter<NotificationsBean, QuickViewHolder> {

    private Context context;

    public NotificationsAdapter(Context context) {
        this.context = context;
    }

    @Override
    protected void onBindViewHolder(@NonNull QuickViewHolder holder, int i, @Nullable NotificationsBean bean) {
        holder.setText(R.id.notiTitleTv, "New Campaign Alert!");
        holder.setGone(R.id.notiTypeTv, i != 0 && i != 2);
        holder.setGone(R.id.notiContentTv, i == 0 || i == 2);
        holder.setGone(R.id.contentTv, i != 0 && i != 2);
        if (i == 0) {
            holder.setText(R.id.contentTv, context.getString(R.string.today));
        } else if (i == 3) {
            holder.setText(R.id.contentTv, context.getString(R.string.earlier));
        } else {
            holder.setText(R.id.contentTv, "");
        }

    }

    @NonNull
    @Override
    protected QuickViewHolder onCreateViewHolder(@NonNull Context context, @NonNull ViewGroup viewGroup, int i) {
        return new QuickViewHolder(R.layout.item_notifications, viewGroup);
    }
}